package cn.jsj.finance.bank;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 修改现金支票处理类
 * @author LI
 *
 */
 public class ModifyCashChequeInfo extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
	 public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 调试信息
		 cn.jsj.utils.SysLogger.PrintInfo("修改现金支票");

		 //新建现金支票对象
		 cn.jsj.pojo.TblCashCheque tcc=new cn.jsj.pojo.TblCashCheque();
		 //赋值
		 tcc.setCashChequeBrief(request.getParameter("mCashChequeBrief").trim());
		 tcc.setCashChequeId(Integer.parseInt(request.getParameter("mCashChequeId").trim()));
		 tcc.setCashChequePerson(request.getParameter("mCashChequePerson").trim());
		 tcc.setCashChequeTime(cn.jsj.utils.TimeDispose.transferDate(request.getParameter("mCashChequeTime").trim()));
		 tcc.setChequeAmount(Integer.parseInt(request.getParameter("mCashChequeAmount").trim()));
		 tcc.setChequeApplication(request.getParameter("mCashChequeApplication").trim());

		 //调试信息
		 cn.jsj.utils.SysLogger.PrintInfo("赋值完成！");

		 //更新数据
		 cn.jsj.dao.TblCashChequeDAO tccd=new cn.jsj.dao.TblCashChequeDAO();
		 int updateResult=tccd.updateCashChequeInfo(tcc);

		 //输出流
		 java.io.PrintWriter out=response.getWriter();

		 //如果更新成功
		 if(updateResult==1){
			 out.println("{message:'更新成功！'}");
		 }else{
			 out.println("{message:'更新失败！'}");
		 }
		 out.flush();
		 out.close();
	}
}